#-*- codeing = utf-8 -*-
#@Time : 2020/8/8 16:03
#@Author : 阳某
#@File : selenium_test.py
#@Software : PyCharm

from selenium import webdriver

'''
chrome = webdriver.Chrome()
chrome.get('https://www.baidu.com')
# chrome.save_screenshot('baidu.png')     #保存屏幕截图
html = chrome.page_source
print(html)
# chrome.quit()
# chrome.close()
'''
'''
chrome = webdriver.Chrome()
chrome.get('http://cn.bing.com')
chrome.find_element_by_id("sb_form_q").send_keys("python")
chrome.find_element_by_id("sb_form_go").click()

'''
# 无头浏览器
options = webdriver.ChromeOptions()
options.add_argument("--headless")
chrome = webdriver.Chrome(chrome_options=options)
chrome.get("https://www.baidu.com")
html = chrome.page_source
print(html)

